package com.xja.boot.demo;


import com.xja.boot.demo.controller.DemoController;
import com.xja.boot.demo.entity.StudentInfo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

@RunWith(SpringRunner.class)
@SpringBootTest(classes = BootDemoStart.class)
public class BootDemoTest {
    //获取容器中的对象
    @Autowired
    private DemoController demoController;
    @Autowired
    private StudentInfo studentInfo;

    @Test
    public void testController(){
        System.out.println("测试控制器");
        System.out.println(demoController.getNameList());
    }
    @Test
    public void testInfo(){
        System.out.println("测试普通对象");
        System.out.println(studentInfo);
        System.out.println("增加了个测试方法");
    }

}
